package com.zq.im.room.dao;

import com.zq.im.room.entity.User;

import java.util.List;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import io.reactivex.Completable;
import io.reactivex.Single;

/**
 * Created by 张强 869518570@qq.com on 2020/9/27
 */
@Dao
public interface UserDao {


    @Query("select * from user where id = :id limit 1")
    Single<User> getUser(String id);


    /**
     * 查询好友列表之后,插入到好友表中
     * @return
     */
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Completable insertAll(List<User> users);

}
